<!doctype html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-model="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

<div id="app">

    <my-component>
        <h1 slot="header">页面标题</h1>
        <p>内容-1</p>
        <p>内容-2</p>
        <div slot="footer">联系信息</div>
        <p>内容-3</p>
        <p>内容-4</p>
    </my-component>


</div>


</body>
<script src="../../../vender/vue@2.4.2.js"></script>
<script>
    var myComponent={
        template:`<div class="layout">
            <header>
                <slot name="header"></slot>
            </header>
            <hr>
            <main>
                <slot></slot>
            </main>
            <hr>
            <footer>
                <slot name="footer"></slot>
            </footer>
        </div>`
    };

    var app=new Vue({
        el:'#app',
        components:{
            'my-component':myComponent
        }
    });


</script>
</html>